package test.org.spring.boot.example.mybatis.plugin;

import org.apache.ibatis.plugin.Interceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.spring.boot.example.mybatis.plugin.MysqlSlowSqlExplainInterceptor;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

@Configuration
@EnableAutoConfiguration
@MapperScan("test.org.spring.boot.example.mybatis.plugin.mapper")
@PropertySource("application.properties")
public class BootStartConfiguration {

	@Bean
	public Interceptor slowSqlExplainInterceptor() {
		MysqlSlowSqlExplainInterceptor itr = new MysqlSlowSqlExplainInterceptor(2000);
		return itr;
	}
}
